package com.qfjy.project.meeting;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * todo 负责进行页面跳转的方法
 */
@Controller
@Slf4j
@RequestMapping("/page")
public class IndexController {
    /**
     * todo 进入登录页面
     */
    @GetMapping("/userLogin")
    public String userLogin( HttpServletRequest request) {
        String openid = request.getParameter("openid");
        String wid = request.getParameter("wid");

        request.setAttribute("openid", openid);
        request.setAttribute("wid", wid);
        return "user/login";
    }

    /**
     * todo 进入无权限页面
     */
    @GetMapping("/unauth")
    public String unauth() {
        // 进入权限页面
        return "unauth";
    }

    /**
     * todo 进入可抢单列表页面
     */
    @GetMapping("/meetingGrabList")
    public String meetingGrabList(HttpServletRequest request) {
        String encryptUid = request.getParameter("encryptUid");

        request.setAttribute("encryptUid",encryptUid);
        return "meetingGrab/list";
    }

}
